
mob
	chatter
		verb
			// Temporary, toggle name notify.
			/*Notify()
				name_notify = !name_notify

				src << "You will no[name_notify ? "w" : "t"] be notified if your name is said."*/


			Vote(ballot as text|null)
				return
				var/OpRank/Rank = ChatMan.Rank(name)
				if(!ballot)
					usr << output("Voting Failed. usage: /Vote Privilege Name", "[ckey(Chan.name)].chat.default_output")
					usr << output("Available privileges: Promote Demote Mute Voice Kick Ban Unban", "[ckey(Chan.name)].chat.default_output")
					return
				var/space = findtext(ballot, " ")
				var/privilege = lowertext(copytext(ballot, 1, space))
				var/target
				if(space && (length(ballot) > space))
					target = copytext(ballot, space+1)
				switch(privilege)
					if("promote") votePromote(privilege, Rank, target)
					if("demote")  voteDemote (privilege, Rank, target)
					if("mute")    voteMute   (privilege, Rank, target)
					if("voice")   voteVoice  (privilege, Rank, target)
					if("kick")    voteKick   (privilege, Rank, target)
					if("ban")     voteBan    (privilege, Rank, target)
					if("unban")   voteUnban  (privilege, Rank, target)

			// &^%$
			// images get cached.
			Send(target as text|null|mob in Home.chatters, file as file|null)
				src << "<tt><font color=red>Temporarily disabled.</font></tt>"
				return
				if(!target)
					target = input("Who would you like to send a file to?", "Send File") as text|null
					if(!target) return
				var/mob/chatter/C
				if(ismob(target)) C = target
				else C = ChatMan.Get(target)
				if(!C)
					if(src.Chan)
						src << output("[target] is not currently online.", "[ckey(src.Chan.name)].chat.default_output")
					else
						alert("[target] is not currently online.", "Unable to locate chatter")
				else
					if(ismob(C))
						var/ign = C.ignoring(ckey)
						if(ign & FILES_IGNORE)
							alert("[C.name] is currently ignoring files from you.", "Unable to Transfer File")
							return
						if(!file)
							file = input("Select the file you wish to send to [C.name]", "Upload File") as file|null
							if(!file) return
						if(length(file) > MAX_FILE_SIZE)
							alert("This file ([fsize(file)]) exceeds the limit of [fsize(MAX_FILE_SIZE)].","File Size Limit Exceeded.")
							fdel(file)
							return
					switch(alert(C, "[name] is trying to send you a file: [file] ([fsize(file)])","[name] File Transfer","Accept","Reject","Ignore"))
						if("Accept")
							C << ftp(file)
							alert("File ([file]) accepted by [C.name].","File Transfer Complete")
						if("Reject")
							alert("File ([file]) rejected by [C.name].","File Transfer Failed")
						if("Ignore")
							C.Ignore(name,"files")
							alert("File ([file]) rejected by [C.name].","File Transfer Failed")

			login(telnet_key as text|null)
				set hidden = 1
				if(!telnet_key)
					src << "<tt><font color='red'><b>** \n Command: <mob/chatter> login([telnet_key]) \n telnet_key invalid. \n **</b></font></tt>"
					return
				if(!telnet)
					src << "<tt><font color='red'><b>** \n Command: <mob/chatter> login([telnet_key]) \n not a telnet user. \n **</b></font></tt>"
					return
				var/savefile/S = new("./data/saves/tel.net")
				if(!S || !length(S))
					src << "<tt><font color='red'><b>** \n Command: <mob/chatter> login([telnet_key]) \n telnet savefile non-existant. \n **</b></font></tt>"
					return
				var/list/L = new
				S["telnet"] >> L
				if(!L || !L.len)
					src << "<tt><font color='red'><b>** \n Command: <mob/chatter> login([telnet_key]) \n no telnet keys saved. \n **</b></font></tt>"
					return
				var/key_hash = md5(telnet_key)
				if(key_hash in L)
					var/telnet_pass = input("Please enter your telnet password:", "Telnet Key Login") as password|null
					if(!telnet_pass)
						src << "<tt><font color='red'><b>** \n Command: <mob/chatter> login([telnet_key]) \n password input invalid. \n **</b></font></tt>"
						return
					if(L[key_hash] != md5(telnet_pass))
						src << "<tt><font color='red'><b>** \n Command: <mob/chatter> login([telnet_key]) \n password invalid. \n **</b></font></tt>"
						return
					name = telnet_key
					fade_name = name
					src << "<b>You have successfully logged in as [name]</b>"
					Home.UpdateWho()
				S["telnet"] << L

			Set()
				call(usr, "ShowSet")()

			Help()
				ShowHelp()

			Cmail()
				set hidden = 1
				ShowChattersMail()

			Say(msg as text|null)
				if(!msg) return
				if(afk) ReturnAFK()
				for(var/i=1,i<=5,i++)
					if(!client) continue
					winset(src, "[ckey(Home.name)].tag[i]", "is-checked=false")
				for(var/i=1,i<=7,i++)
					if(!client) continue
					winset(src, "[ckey(Home.name)].color[i]", "is-checked=false;text=")
					var/C = src.Colors[i]
					src.Colors[C] = null
				if(Chan)
					Chan.Say(src, msg)

			Me(msg as text|null)
				if(!msg) return
				if(afk) ReturnAFK()
				Chan.Me(src, msg)

			My(msg as text|null)
				if(!msg) return
				if(afk) ReturnAFK()
				Chan.My(src, msg)

			IM(target as text|null|mob in Home.chatters, msg as text|null)
				if(!target)
					var/Messenger/im = new(src)
					im.Display(src)
					return
				var/mob/C
				if(ismob(target)) C = target
				else C = ChatMan.Get(target)
				if(!C)
					if(src.Chan)
						src << output("[target] is not currently online.", "[ckey(src.Chan.name)].chat.default_output")
					else
						alert(src, "[target] is not currently online.", "Unable to locate chatter")
				else
					if(ismob(C))
						if(!msg)
							var/Messenger/im = new(src, C.name)
							im.Display(src)
							return
						if(length(msg)>512)
							var/part2 = copytext(msg, 513)
							msg = copytext(msg, 1, 513)
							spawn(20) IM(C.name, part2)

						var/Messenger/im = new(src, C.name)
						im.Display(src)
						MsgMan.RouteMsg(src, C, msg)
					else
						if(!msg)
							var/Messenger/im = new(src, C)
							im.Display(src)
							return
						if(length(msg)>512)
							var/part2 = copytext(msg, 513)
							msg = copytext(msg, 1, 513)
							spawn(20) IM(C, part2)

						var/Messenger/im = new(src, C)
						im.Display(src)
						var/savefile/S = new()
						var/mob/chatter/M = new()

						M.name = name
						M.name_color = name_color
						M.text_color = text_color
						M.fade_name = fade_name
						M.picture = picture
						M.age = age
						M.location = location
						M.description = description
						M.interests = interests

						S["from"] << M
						S["msg"] << msg
						S["to"] << C

						src << output(src.ParseMsg(src, msg, src.say_format), "cim_[ckey(C)].output")
						world.Export("[NetMan.Chatters[C]]?dest=msgman&action=msg",S)

			Ignore(mob/target as text|null|mob in Home.chatters, scope as text|null|anything in list("im", "chat", "fade", "colors", "smileys", "images", "files", "full"))
				if(!target)
					if(src.Chan)
						src << output("Please provide a name. Proper usage: /Ignore \"Chatter\" \"scope\" Available Scopes: im, chat, fade, colors, smileys, images, files, full", "[ckey(Home.name)].chat.default_output")
					else
						alert("Please provide a name. Proper usage: /Ignore \"Chatter\" \"scope\" Available Scopes: im, chat, fade, colors, smileys, images, files, full", "Ignore")
					return
				if(!ignoring) ignoring = new
				if(ismob(target)) target = target.name
				var/is_ignored = ignoring(target)
				if(is_ignored == FULL_IGNORE)
					if(src.Chan)
						src << output("You are already ignoring [target].", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are already ignoring [target].", "Unable to ignore chatter")
					return
				if(!scope) scope = "[FULL_IGNORE]"
				var/ignore_type = "this scope"
				switch(scope)
					if("im")
						scope = "[IM_IGNORE]"
						ignore_type = "instant messages"
					if("chat")
						scope = "[CHAT_IGNORE]"
						ignore_type = "chat messages"
					if("fade")
						scope = "[FADE_IGNORE]"
						ignore_type = "fades"
					if("colors")
						scope = "[COLOR_IGNORE]"
						ignore_type = "colors"
					if("smileys")
						scope = "[SMILEY_IGNORE]"
						ignore_type = "smileys"
					if("images")
						scope = "[IMAGES_IGNORE]"
						ignore_type = "images"
					if("files")
						scope = "[FILES_IGNORE]"
						ignore_type = "files"
					if("full")		scope = "[FULL_IGNORE]"
				var/num = text2num(scope)
				if(num && isnum(num))
					if(num & is_ignored)
						if(src.Chan)
							src << output("You are already ignoring [ignore_type] from [target].", "[ckey(Home.name)].chat.default_output")
						else
							alert("You are already ignoring [ignore_type] from [target].","Unable to ignore chatter")
						return
					num += is_ignored
					ignore_type = ""
					if(num == 31) num = FULL_IGNORE
					if(num & FULL_IGNORE) scope = FULL_IGNORE
					else
						scope = 0
						if(num & IM_IGNORE)
							scope |= IM_IGNORE
							ignore_type += "\n	- instant messages"
							if(ckey(target) in msgHandlers)
								winset(src, "cim_[ckey(target)]", "is-visible=false")
						if(num & CHAT_IGNORE)
							scope |= CHAT_IGNORE
							ignore_type += "\n	- chat messages"
						if(num & FADE_IGNORE)
							scope |= FADE_IGNORE
							ignore_type += "\n	- fade name"
						if(num & COLOR_IGNORE)
							scope |= COLOR_IGNORE
							ignore_type += "\n	- colors"
						if(num & SMILEY_IGNORE)
							scope |= SMILEY_IGNORE
							ignore_type += "\n	- smileys"
						if(num & IMAGES_IGNORE)
							scope |= IMAGES_IGNORE
							ignore_type += "\n	- images"
						if(num & FILES_IGNORE)
							scope |= FILES_IGNORE
							ignore_type += "\n	- files"
						if(!scope)
							if(src.Chan)
								src << output("The scope you provided did not match a known ignore scope. Available Scopes: im, chat, fade, colors, smileys, images, files, full", "[ckey(Home.name)].chat.default_output")
							else
								alert("The scope you provided did not match a known ignore scope. Available Scopes: im, chat, fade, colors, smileys, images, files full","Unable to ignore chatter")
							return
				else
					if(src.Chan)
						src << output("The scope you provided did not match a known ignore scope. Available Scopes: im, chat, fade, colors, smileys, images, files full", "[ckey(Home.name)].chat.default_output")
					else
						alert("The scope you provided did not match a known ignore scope. Available Scopes: im, chat, fade, colors, smileys, images, files full","Unable to ignore chatter")
					return
				if(!is_ignored) ignoring += ckey(target)
				ignoring[ckey(target)] = scope
				if(length(ignore_type))
					if(src.Chan)
						src << output("You are now ignoring the following from [target]: [ignore_type]", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are now ignoring the following from [target]: [ignore_type]", "Ignoring chatter")
				else
					if(src.Chan)
						src << output("You are now fully ignoring [target].", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are now fully ignoring [target].", "Ignoring chatter")
				ChatMan.Save(src)


			Unignore(mob/target as text|null|anything in ignoring, scope as text|null|anything in list("im", "chat", "fade", "colors", "smileys", "images", "files", "full"))
				if(!target)
					if(src.Chan)
						src << output("Please provide a name. Proper usage: /Unignore \"Chatter\" \"scope\" Available Scopes: im, chat, fade, colors, smileys, images, files, full", "[ckey(Home.name)].chat.default_output")
					else
						alert("Please provide a name. Proper usage: /Unignore \"Chatter\" \"scope\" Available Scopes: im, chat, fade, colors, smileys, images, files, full", "Unignore")
					return
				if(!ignoring || !ignoring.len)
					if(src.Chan)
						src << output("You are not currently ignoring any chatters.", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are not currently ignoring any chatters.", "Unable to unignore chatter")
					return
				if(ismob(target)) target = target.name
				var/ign = ignoring(target)
				if(!ign)
					if(src.Chan)
						src << output("You are not currently ignoring [target]", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are not currently ignoring [target]", "Unable to unignore chatter")
					return
				if(!scope) scope = "[FULL_IGNORE]"
				var/ignore_type = "this scope"
				switch(scope)
					if("im")
						scope = "[IM_IGNORE]"
						ignore_type = "instant messages"
					if("chat")
						scope = "[CHAT_IGNORE]"
						ignore_type = "chat messages"
					if("fade")
						scope = "[FADE_IGNORE]"
						ignore_type = "fades"
					if("colors")
						scope = "[COLOR_IGNORE]"
						ignore_type = "colors"
					if("smileys")
						scope = "[SMILEY_IGNORE]"
						ignore_type = "smileys"
					if("images")
						scope = "[IMAGES_IGNORE]"
						ignore_type = "images"
					if("files")
						scope = "[FILES_IGNORE]"
						ignore_type = "files"
					if("full")		scope = "[FULL_IGNORE]"
				var/num = text2num(scope)
				if(num && isnum(num))
					if((num != FULL_IGNORE) && !(num & ign))
						if(src.Chan)
							src << output("You are not currently ignoring [ignore_type] from [target].", "[ckey(Home.name)].chat.default_output")
						else
							alert("You are not currently ignoring [ignore_type] from [target].","Unable to unignore chatter")
						return
					ignore_type = ""
					if(num == 31) num = FULL_IGNORE
					if(num & FULL_IGNORE) scope = FULL_IGNORE
					else
						scope = 0
						if(num & IM_IGNORE)
							scope |= IM_IGNORE
							if(ign - IM_IGNORE)
								ignore_type += "\n	- instant messages"
						if(num & CHAT_IGNORE)
							scope |= CHAT_IGNORE
							if(ign - CHAT_IGNORE)
								ignore_type += "\n	- chat messages"
						if(num & FADE_IGNORE)
							scope |= FADE_IGNORE
							if(ign - FADE_IGNORE)
								ignore_type += "\n	- fade name"
						if(num & COLOR_IGNORE)
							scope |= COLOR_IGNORE
							if(ign - COLOR_IGNORE)
								ignore_type += "\n	- colors"
						if(num & SMILEY_IGNORE)
							scope |= SMILEY_IGNORE
							if(ign - SMILEY_IGNORE)
								ignore_type += "\n	- smileys"
						if(num & IMAGES_IGNORE)
							scope |= IMAGES_IGNORE
							if(ign - IMAGES_IGNORE)
								ignore_type += "\n	- images"
						if(num & FILES_IGNORE)
							scope |= FILES_IGNORE
							if(ign - FILES_IGNORE)
								ignore_type += "\n	- files"
						if(!scope)
							if(src.Chan)
								src << output("The scope you provided did not match a known ignore scope. Available Scopes: im, chat, fade, colors, smileys, images, files, full", "[ckey(Home.name)].chat.default_output")
							else
								alert("The scope you provided did not match a known ignore scope. Available Scopes: im, chat, fade, colors, smileys, images, files, full","Unable to unignore chatter")
							return
				else
					if(src.Chan)
						src << output("The scope you provided did not match a known ignore scope. Available Scopes: im, chat, fade, colors, smileys, images, files, full", "[ckey(Home.name)].chat.default_output")
					else
						alert("The scope you provided did not match a known ignore scope. Available Scopes: im, chat, fade, colors, smileys, images, files, full","Unable to unignore chatter")
					return
				if(scope == FULL_IGNORE) ignoring -= ckey(target)
				else ignoring[ckey(target)] &= ~scope
				if(!ignoring[ckey(target)])
					ignoring -= ckey(target)
					ignore_type = ""
				if(length(ignore_type))
					if(src.Chan)
						src << output("You are no longer ignoring the following from [target]: [ignore_type]", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are no longer ignoring the following from [target]: [ignore_type]", "Unignoring chatter")
				else
					if(src.Chan)
						src << output("You are no longer ignoring [target].", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are no longer ignoring [target].", "Unignoring chatter")
				ChatMan.Save(src)

			Ignoring(mob/target as text|null|anything in ignoring)
				if(!ignoring || !ignoring.len)
					if(src.Chan)
						src << output("You are not currently ignoring any chatters.", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are not currently ignoring any chatters.", "No chatters ignored")
					return
				if(!target)
					var/ignored
					for(var/i in ignoring)
						var/scoped
						if((ignoring[i] & FULL_IGNORE)) scoped = "Full ignore"
						else
							if((ignoring[i] & IM_IGNORE))
								if(!scoped) scoped = "IMs"
								else scoped += ", IMs"
							if((ignoring[i] & CHAT_IGNORE))
								if(!scoped) scoped = "chat"
								else scoped += ", chat"
							if((ignoring[i] & FADE_IGNORE))
								if(!scoped) scoped = "fade name"
								else scoped += ", fade name"
							if((ignoring[i] & COLOR_IGNORE))
								if(!scoped) scoped = "colors"
								else scoped += ", colors"
							if((ignoring[i] & SMILEY_IGNORE))
								if(!scoped) scoped = "smileys"
								else scoped += ", smileys"
							if((ignoring[i] & IMAGES_IGNORE))
								if(!scoped) scoped = "images"
								else scoped += ", images"
							if((ignoring[i] & FILES_IGNORE))
								if(!scoped) scoped = "files"
								else scoped += ", files"
						ignored += "\n[i] - [scoped]"
					if(src.Chan)
						src << output("You are currently ignoring the following chatters.[ignored]", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are currently ignoring the following chatters.[ignored]", "Not Ignoring chatter")
					return
				if(ismob(target)) target = target.name
				var/ign = ignoring(target)
				if(!ign)
					if(src.Chan)
						src << output("You are not currently ignoring [target]", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are not currently ignoring [target]", "Not Ignoring chatter")
					return
				var/ignore_type = ""
				if(!(ign & FULL_IGNORE))
					if(ign & IM_IGNORE)
						if(ign - IM_IGNORE)
							ignore_type += "\n	- instant messages"
					if(ign & CHAT_IGNORE)
						if(ign - CHAT_IGNORE)
							ignore_type += "\n	- chat messages"
					if(ign & FADE_IGNORE)
						if(ign - FADE_IGNORE)
							ignore_type += "\n	- fade name"
					if(ign & COLOR_IGNORE)
						if(ign - COLOR_IGNORE)
							ignore_type += "\n	- colors"
					if(ign & SMILEY_IGNORE)
						if(ign - SMILEY_IGNORE)
							ignore_type += "\n	- smileys"
					if(ign & IMAGES_IGNORE)
						if(ign - IMAGES_IGNORE)
							ignore_type += "\n	- images"
					if(ign & FILES_IGNORE)
						if(ign - FILES_IGNORE)
							ignore_type += "\n	- files"
				if(length(ignore_type))
					if(src.Chan)
						src << output("You are ignoring the following from [target]: [ignore_type]", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are ignoring the following from [target]: [ignore_type]", "Ignoring chatter")
				else
					if(src.Chan)
						src << output("You are fully ignoring [target].", "[ckey(Home.name)].chat.default_output")
					else
						alert("You are fully ignoring [target].", "Ignoring chatter")

			Look()
				if(!Chan) return
				if(!Chan.room_desc)
					src << output("Looking around, you see....\n\tAn average looking room.", "[ckey(Chan.name)].chat.default_output")
					return
				if(Chan.room_desc_size >= 500)
					switch(alert("This room description exceeds the recomended room description size. (500 characters) Would you like to view it anyways?","Room Description Size Alert! [Chan.room_desc_size] characters!","Yes","No"))
						if("No") return
				src << output("Looking around, you see....\n\t[Chan.room_desc]", "[ckey(Chan.name)].chat.default_output")


			LookAt(t as text|null|mob in Home.chatters)
				if(!t) return
				var/mob/chatter/C
				if(ismob(t)) C = t
				else C = ChatMan.Get(t)
				if(!C)
					if(src.Chan)
						src << output("[t] is not currently online.", "[ckey(src.Chan.name)].chat.default_output")
					else
						alert(src, "[t] is not currently online.", "Unable to locate chatter")
				else
					src << output(null, "profile.output")
					if(C.picture)
						src << output("<img src='[C.picture]' width=64 height=64>\...", "profile.output")
					else
						src << browse_rsc('./resources/images/noimage.png', "noimage.png")
						src << output("<img src='noimage.png' width=64 height=64>\...", "profile.output")
					winset(src, "profile.key", "text=' [TextMan.escapeQuotes(C.name)]")
					winset(src, "profile.age", "text=' [TextMan.escapeQuotes(C.age)]")
					winset(src, "profile.gender", "text=' [C.gender]")
					winset(src, "profile.location", "text=' [TextMan.escapeQuotes(C.location)]")
					winset(src, "profile.description", "text=' [TextMan.escapeQuotes(C.description)]")
					winset(src, "profile.interests", "text=' [TextMan.escapeQuotes(C.interests)]")
					winset(src, "profile", "is-visible=true")
					winset(src, "profile.im_button", "command='IM \"[C.name]\"';")

			ShowCode(t as text|null|mob in Home.chatters)
				if(afk) ReturnAFK()
				if(t)
					var/mob/chatter/C
					if(ismob(t)) C = t
					else C = ChatMan.Get(t)
					if(!C)
						if(src.Chan)
							src << output("[t] is not currently online.", "[ckey(src.Chan.name)].chat.default_output")
						else
							alert(src, "[t] is not currently online.", "Unable to locate chatter")
					else
						var/ign = C.ignoring(src)
						if(ign && CHAT_IGNORE)
							src << "<b>Unable to show code!</b>"
							src << "[C.name] is ignoring you."
							return
						var/message = input("Enter your code below:","Show Code in the browser") as message | null
						if(!message) return
						if(!showcodes) showcodes = new
						showcodes += message
						showcodes[message] = C.name
						var/html = "<html><head><title>To: [C.name] \
							- Private Code Window</title>[src.show_highlight ? DefaultHighlightStyles(".ident", "color:#000", ".number", "color:#000") : null]\
							</head><body><pre>[src.show_highlight ? HighlightCode(message): message]</pre></body></html>"
						var/window = "window=[C.name]_private"
						//winclone(src, "show_window", window)
						//winset(src, window, "is-visible=true;")
						//src << output(html, "[window].browser")
						src << browse(html, window)
						var/Messenger/im = new(src, C.name)
						im.Display(src)
						MsgMan.RouteMsg(src, C, "Click for my <a href='byond://?dest=chatman&action=see_code&target=[src.name]&index=[src.showcodes.len]&type=Private'>Show Code Window</a>.",1)
				else
					if(!src.Chan || Chan.ismute(src)) return
					var/message = input("Enter your code below:", "Show Code in the browser") as message | null
					if(!message) return
					if(!showcodes) showcodes = new
					showcodes += message
					var/html = "<title>To: [src.Chan.name] \
						 - Public Code Window</title>[src.show_highlight ? DefaultHighlightStyles(".ident", "color:#000", ".number", "color:#000") : null]\
						 <pre>[src.show_highlight ? HighlightCode(message) : message]</pre>"
					var/window = "window=[src.name]_public"
					//winclone(src, "show_window", window)
					//winset(src, window, "is-visible=true;")
					//src << output(html, "[window].browser")
					src << browse(html, window)
					Chan.Say(src, "Click for my <a href='byond://?dest=chatman&action=see_code&target=[src.name]&index=[src.showcodes.len]&type=Public'>Show Code Window</a>.",1)

			afk(msg as text|null)
				if(!Chan) return
				if(!afk)
					if(!msg) msg = auto_reason
					Home.GoAFK(src, msg)
				else
					ReturnAFK()

			ShowText(t as text | null|mob in Home.chatters)
				if(afk) ReturnAFK()
				if(t)
					var/mob/chatter/C
					if(ismob(t)) C = t
					else C = ChatMan.Get(t)
					if(!C)
						if(src.Chan)
							src << output("[t] is not currently online.", "[ckey(src.Chan.name)].chat.default_output")
						else
							alert(src, "[t] is not currently online.", "Unable to locate chatter")
					else
						var/ign = C.ignoring(src)
						if(ign && CHAT_IGNORE)
							src << "<b>Unable to show text!</b>"
							src << "[C.name] is ignoring you."
							return
						var/message = input("Enter your text below:","Show Text in the browser") as message | null
						if(!message) return
						var/list/L = text2list(message)	// replaces newline characters with <br> tags
						for(var/l = 1, l <= L.len, l++) // and tab characters with 8 non-breaking spaces
							if(text2ascii(L[l]) == 10)	// newline character
								L[l] = "<br>"			// replace with html
							if(text2ascii(L[l]) == 9)
								L[l] = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
							if(text2ascii(L[l]) == 32)
								L[l] = "&nbsp;"
						message = list2text(L)

						message = TextMan.check_links(message)

						message = TextMan.remove_script(message)

						if(!showtexts) showtexts = new
						showtexts += message
						showtexts[message] = C.name

						var/html = {"
								<html><head><title>To: [src.Chan.name] - Private Text Window</title></head>
								<body>[message]</body></html>
									"}
						var/window = "window=[src.name]_private"
						//winclone(src, "browser", window)
						//winshow(src, window, 1)
						//src << output(html, "[window].browse")
						src << browse(html, window)
						var/Messenger/im = new(src, C.name)
						im.Display(src)
						MsgMan.RouteMsg(src, C, "Click for my <a href='byond://?dest=chatman&action=see_text&target=[src.name]&index=[src.showtexts.len]&type=Private'>Show Text Window</a>.",1)
						return
				else
					if(!src.Chan || Chan.ismute(src)) return
					var/message = input("Enter your text below:","Show Text in the browser") as message | null
					if(!message) return

					var/list/L = text2list(message)	// replaces newline characters with <br> tags
					for(var/l = 1, l <= L.len, l++) // and tab characters with 8 non-breaking spaces
						if(text2ascii(L[l]) == 10)	// newline character
							L[l] = "<br>"			// replace with html
						if(text2ascii(L[l]) == 9)
							L[l] = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
						if((l+1<L.len) && (text2ascii(L[l]) == 32) && (text2ascii(L[l+1]) == 32))
							L[l] = "&nbsp;"
					message = list2text(L)

					message = TextMan.remove_script(message)

					if(!showtexts) showtexts = new
					showtexts += message

					var/html = {"
							<html><head><title>To: [src.Chan.name] - Public Text Window</title></head>
							<body>[message]</body></html>
								"}
					var/window = "window=[src.name]_public"
					//winclone(src, "browser", window)
					//winshow(src, window, 1)
					//src << output(html, "[window].browse")
					src << browse(html, window)
					Chan.Say(src, "Click for my <a href='byond://?dest=chatman&action=see_text&target=[src.name]&index=[src.showtexts.len]&type=Public'>Show Text Window</a>.",1)


			ShowTextInline(message as message)
				if(afk) ReturnAFK()
				if(!message) return
				if(!src.Chan || Chan.ismute(src)) return

				var/list/L = text2list(message)	// replaces newline characters with <br> tags
				for(var/l = 1, l <= L.len, l++) // and tab characters with 8 non-breaking spaces
					if(text2ascii(L[l]) == 10)	// newline character
						L[l] = "<br>"			// replace with html
					if(text2ascii(L[l]) == 9)
						L[l] = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
					if((l+1<L.len) && (text2ascii(L[l]) == 32) && (text2ascii(L[l+1]) == 32))
						L[l] = "&nbsp;"
				message = list2text(L)

				message = TextMan.remove_script(message)

				if(!showtexts) showtexts = new
				showtexts += message

				var/html = {"
						<html><head><title>To: [src.Chan.name] - Public Text Window</title></head>
						<body>[message]</body></html>
							"}
				var/window = "window=[src.name]_public"
				src << browse(html, window)
				Chan.Say(src, "Click for my <a href='byond://?dest=chatman&action=see_text&target=[src.name]&index=[src.showtexts.len]&type=Public'>Show Text Window</a>.",1)

			TelnetType(ttype as num)
				telnet_type = ttype





			BanPrompt(unruly = "", reason = "", duration = "", telnetcb = "", keycb = "true", ipcb = "")
				winclone(src, "ban", "[ckey]_ban")
				//winset(src, "[ckey]_ban", "")
				winset(src, "[ckey]_ban", "is-visible=true")

			BanCancelInput()
				set hidden = 1
				winset(src, "[ckey]_ban", "is-visible=false")
				/*winset(src, "[ckey]_ban.ban_input", "text=")
				winset(src, "[ckey]_ban.ban_reason_input", "text=")
				winset(src, "[ckey]_ban.ban_duration_input", "text=")*/

			BanInput()
				set hidden = 1
				winset(src, "[ckey]_ban", "is-visible=false")
				var ban_unruly = winget(src, "[ckey]_ban.ban_input", "text")
				var ban_reason = winget(src, "[ckey]_ban.ban_reason_input", "text")
				var ban_duration = winget(src, "[ckey]_ban.ban_duration_input", "text")
				var ban_telnet = winget(src, "[ckey]_ban.ban_telnet_checkbox", "is-checked")
				var ban_key = winget(src, "[ckey]_ban.ban_key_checkbox", "is-checked")
				var ban_ip = winget(src, "[ckey]_ban.ban_ip_checkbox", "is-checked")

				world << ban_unruly
				world << ban_reason
				world << ban_duration
				world << ban_telnet
				world << ban_key
				world << ban_ip